package cc.mcyx.ychat.config

import cc.mcyx.ychat.fillter.AppFilter
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.context.annotation.Configuration
import org.springframework.web.servlet.config.annotation.InterceptorRegistry
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer

@Configuration
open class WebConfig : WebMvcConfigurer {
    @Autowired
    lateinit var appFilter: AppFilter

    override fun addInterceptors(registry: InterceptorRegistry) {
        registry.addInterceptor(appFilter).addPathPatterns("/**").excludePathPatterns("/public/**")
    }
}